#include <thread>
#include <vector>

#include <logger.h>

int main()
{
    int sum = 0;
    int one = 1; // 让编译器优化失效
    auto func = [&sum, one]() {
        for (int i = 0; i < 1e4 * one; i++) {
            sum++;
        }
    };

    std::vector<std::thread> threads;
    for (int i = 0; i < 10; i++) {
        threads.emplace_back(func);
    }

    for (auto &thread : threads) {
        thread.join();
    }

    VALUE_LOGGER(sum);
    return 0;
}
